package example.controller;

import cn.hutool.crypto.SecureUtil;
import example.config.properties.RedissonProperties;
import example.utils.RedisUtils;
import io.reactivex.rxjava3.core.Completable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 授权 控制
 *
 * @Author 阿欣
 * @Date 2021/8/18 18:58
 */
@RestController
@RequestMapping("/example")
public class ExampleController {

    @GetMapping
    public String example() {
        return RedisUtils.getCacheObject("example").toString();
    }


    public static void main(String[] args) {
        String oldPassword = "e10adc3949ba59abbe56e057f20f883e";
        String password = "123456";

        System.out.println(SecureUtil.hmacMd5().verify(password.getBytes(), oldPassword.getBytes()));
    }



}
